extends Node


var stack=[]
var detectList=[]
var _Watcher
func _ready():
	_Watcher=load("res://scripts/watcher/Watcher.gd")
	pass
func activeWatcher():
	if stack.size()==0:
		return null
	return stack.back()

func w(value):
	return _Watcher.new().start(value)

func w2(target,fnStr):
	return _Watcher.new().start2(target,fnStr)
var is_wait=false
var waitQueue=[]
#暂时停止通知，当需要同时变更多个属性时，防止重复计算多次
func wait_start():
	is_wait=true
	pass
#开始通知
func wait_end():
	while waitQueue.size()>0:
		var arr=waitQueue.duplicate()
		waitQueue.clear()
		for w in arr:
			if !w.disposed:
				w.calValue()
	is_wait=false
